
def outer():
    count = 0
    def inner():
        nonlocal count
        count += 1
        print(f'调用了{count}次')
    return inner

counter =  outer()

counter()
counter()
counter()